/*
 * Player.h
 *
 *  Created on: Oct 13, 2011
 *	Created by: Devin Manno
 *  Updated by: Devin Manno
 *	Last Update: Oct 27, 2011
 */

#ifndef PLAYER_H_
#define PLAYER_H_

#include "Character.h"
#include "PlayerStats.h"
#include "Potion.h"
#include <string>

class Player: public Character {

private:
	PlayerStats playerStats;
	void setupPlayer();		// setup the rest of the player's members during player creation
	bool unlock(int);
	enum unlockLevels {UNLOCK1 = 5,UNLOCK2 = 10,UNLOCK3 = 15,UNLOCK4 = 20}; // levels at which players unlock abilities

public:
	Player(string characterName, CharClass cClass, PlayerStats pStats) :	// controller class will generate new player, including name, class and player stats
		Character(characterName, cClass) {
		playerStats = pStats;
		if(cClass == WIZARD)
			playerStats.setActionPointsType("Mana");
		else
			playerStats.setActionPointsType("Endurance");
		setupPlayer();
	}
	virtual ~Player();

	// getters
	std::string getClassName() const;
	PlayerStats& getPlayerStats();		// return the player's stats

	// setters
	bool  equip(EquipmentType* item, std::string &errorMsg);  	//  equip an equipmentType. returns true if successful; errorMsg = reason for failure.
	bool dequip(EquipmentType* item, std::string &errorMsg);  	// dequip an equipmentType. returns true if successful; errorMsg = reason for failure.
	bool usePotion(Potion *potion);				// use a potion. returns true if successful.  controller should delete potion pointer on success.
	bool increaseExp(int);		// increase character experience points
};

#endif /* PLAYER_H_ */
